<template>
    <div class="main">
      <nav-bar class="home-nav">
        <div class="left" slot="left" @click="goBack">
          <van-icon name="arrow-left" size="24"/>
        </div>
        <div slot="center">第三方数据详情</div>
      </nav-bar>

      <div class="detail_box">
        <h1 class="title">{{title}}</h1>
        <div class="date">{{create_date}}</div>
        <div v-html="content" class="content"></div>
        <div>
          <van-uploader v-model="imgList" :show-upload="false" :deletable="false" />
        </div>
      </div>
    </div>
</template>

<script>
  import Util from "@/common/util";
  import NavBar from "@/components/common/navbar/NavBar"
    export default {
        name: "thirdDetail",
      components: {
        NavBar
      },

      data(){
          return {
            id: '',
            title:'',
            content: '',
            create_date:'',
            imgList:[]
          }
      },

      created() {
          this.id = this.$route.query.id;
          this.getDetail();
      },
      methods: {
          getDetail(){
            let that =this;
            that.$http.get('/api/UserCheckApi/getInstitutions', {id:that.id}, r => {
              console.log(r)
               that.title = r.data.title;
              that.content = r.data.content;
              that.create_date = r.data.create_date;

              let Arr = [];
              r.data.certificate.map(item => {
                let Obj ={};
                Obj['url'] = Util.baseURL+item;
                Arr.push(Obj);
                return Arr;
              })

              console.log('ARR',Arr)

              that.imgList = Arr;

            })
          },

        goBack() {
          this.$router.go(-1);
        },
      }
    }
</script>

<style scoped>
  .detail_box{
    margin: 10px;
    line-height: 1.5;
  }
  .title{
    text-align: center;
    font-size: .32rem;
  }
  .content{
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: .32rem;
  }
  .date{
    font-size: .28rem;
    color: #666;
    text-align: center;
  }
</style>
